Generated by
JDiff

org.globalplatform Documentation Differences

This file contains all the changes in documentation in the package org.globalplatform as colored differences. Deletions are shown like this, and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a <code> tag will cause all subsequent paragraphs to be displayed differently.

Class Application

This interface defines thea method through which an Application may forward input data to another Application.

This interface thatshall representsbe implemented by an applet method accessible throughApplication that wishes to thereceive personalization OPEN to thedata forwarded by application'sits associated Security Domain. This interfaceIn must besuch a implementedscenario, byif the Applet Application class that willimplements both the useApplication theand the additionalPersonalization functionalityinterface, allowing athen the Security Domain to pass datashall touse the appletPersonalization interface.

@see Personalization @since export file version 1.0

Class Application, void processData(byte[], short, short)

ThisProcesses method processes application specific data received from another entity on the -card entity.

If this other entity is thethe Application invoking this method Application'sis associateda Security Domain, thisthen datait shall be assumed that:

Notes:

@param baBuffer the source byte array containing theinput data. expected by theMust be a appletglobal byte array. This@param buffersOffset must beoffset globalof input data within baBuffer. @param sOffsetsLength starting offsetlength of input data. within@exception SecurityException if baBuffer sourceis not a global byte array. @param sLengthexception NullPointerException lengthif baBuffer is null. @exception ArrayIndexOutOfBoundsException if reading input data would cause access of data outside array bounds.

Class Authority

This interface provides services to recoverallows performing operations such aas recovering a cryptographic key and toor signsigning data. The CASD shall publish this interface to the OPEN, using Global Service interface, to make itsrequired services available to other Applicationsalgorithms and credentials are known implicitly. The

APSDIt is theintended first entity requiring this service from the CASD asthat Security Domains would be able to access an shownAuthority ininstance 2.1. through There is only one CASD inside thea Global Service by a Controlling Authority card.Security TheDomain (CASD shall register this service) aswith a unique Global Service with the service family identifiername =#83#of (per section GPSystem.FAMILY_AUTHORITY<8.1.3 of GlobalPlatform Card Specification v2.2|0x00).

The Authority interface is responsible@since for

Class Authority, void init(byte)

Initializes the Authority interface with the appropriate mode (MODE_SIGN or MODE_KEY_RECOVERY). @param theMode one of .MODE_SIGN or .MODE_KEY_RECOVERY . @exception CryptoException with the following reason code:
Class Authority, short recoverKey(byte[], short, short, byte[], short)

Recovers a cryptographic key from a set of data structures provided in the input buffer (inBuff). As a mandatory step, the recovery mechanism includes the verification of the origin and integrity of the recovered key. This method knows, from the set of data structures present in the input buffer, which recovery mechanism is to be used. The recovered key is written in the ouput buffer (outBuff) at specified offset (outOffset), in the form of a key data structure whose format depends on the type of the key. A call to this method resets this instance of the Authority interface to the state it was in when previously initialized via a call to init(). That is, the object is reset and available to recover another key. The input and output buffers may overlap and shall be global arrays. @param inBuff containing input data. @param inOffset offset of input data. @param inLength length of input data. @param outBuff the buffer where recovered key data structure shall be written @param outOffset offset where recovered key data structure shall be written @return Length of the recovered key data structure written in outBuff at outOffset,or 0 if the recovery mechanism failed (e.g. recovered key was considered invalid). @throws CryptoException - with the following reason codes: @throws SecurityException if the inBuff or outBuff are not global arrayarrays.
Class Authority, short sign(byte[], short, short, byte[], short)

Generates the signature of all/last input data. A call to this method resets this Authority interface to the state it was in when previously initialized via a call to init(). That is, the object is reset and available to sign another message. The input and output buffer may overlap and shall be global arrays. @param inBuff the input buffer of data to be signed @param inOffset the offset in input buffer at which the signature starts @param inLength the byte length to sign @param sigBuff the output buffer to store signature data @param sigOffset the offset into sigBuff at which to begin signature generation @return the number of bytes of signature output in sigBuff @throws CryptoException with the following reason codes: @throws SecurityException if the inBuff or sigBuff are not global arrayarrays.
Class Authority, void update(byte[], short, short)

Accumulates input data. for the current operation (MODE_SIGN or MODE_KEY_RECOVERY).

When this method is used, temporary storage of intermediate results is required. This method should only be used if all the input data required for the current operation is not available in one byte array. The sign or recoverKey methods are recommended whenever possible. The inBuff shall be global array. @param inBuff buffer containing input data @param inOffset offset of input data @param inLength length of input data @throws CryptoException with the following reason codes:

@throws SecurityException if the inBuff is not global array.
Class Authority, byte MODE_KEY_RECOVERY

Used inwith .init() methodsmethod to indicate key recovery mode.
Class Authority, byte MODE_SIGN

Used inwith .init() methodsmethod to indicate signature signsigning mode.

Class CVM

This interface defines thebasic interfaceCardholder Verification Method services (e.g. comparison of CVM value, CVM state query). It is typically exposed to on-card Applications by a Global Services Application implementing one oror more Cardholder Verification MethodsMethods. ThisSome services class offers basic Cardholder Verification Method servicesare restricted to Applications having the CVM (eManagement Privilege.g

To retrieve an instance of this interface, an Application shall invoke the GPSystem.getCVM method, or shall use a GlobalService instance of the GPSystem.FAMILY_CVM family. For verificationbackward compatibility, the CVM stateinstances interrogation)retrieved tousing anythe GPSystem.getCVM method are mapped onto those retrieved as Global Services of the ApplicationsGPSystem.FAMILY_CVM family.

presentThe onCVM instance maintains the cardfollowing data (see Card Specification v2.2.1 section 8.2.2 for more details):

Operations performed by GlobalServicethis interface objectshall be independent of, and not interfere with, any transaction in progress (s)e.g. if throughthe applet.getShareableInterfaceObject()verify accordingmethod tois invoked from within a transaction and this specification.transaction is aborted, then the try counter is not revert to its original value).

@since

Class CVM, boolean blockState()

ThisSets the CVM state to BLOCKED.

If the Application invoking this method setsdoes not have the CVM Management Privilege, then the CVM state is not updated.

The CVM state can only be set to BLOCKED if the CVM instance already entered the state ACTIVE once, that is, if the CVM instance is fully initialized. Notice that this method shall return true if the CVM state is already BLOCKED.

Notes:

@return true if the CVM state was set to BLOCKED, false otherwise. @see GPRegistryEntry#PRIVILEGE_CVM_MANAGEMENT
Class CVM, byte getTriesRemaining()

ThisGets method returns the number ofCVM try triescounter, remainingthat foris, the CVM. Thisnumber indicates the numberof unsuccessful comparisons of times the CVM value canthat may be incorrectly presented prior to the CVMperformed before this CVM instance gets reachingblocked.

the@return statecurrent value of BLOCKED. the @returnCVM Tries remainingtry counter.

Class CVM, boolean isActive()

ThisIndicates method indicates whether thethis CVM instance is active, that is, whether it has been fully presentinitialized (i.e. both value and try limit) and activatedis ready for use. If activeyes, then the CVM couldstate is deemed to be in any one of thethe following states: ACTIVE, INVALID_SUBMISSION, VALIDATED or BLOCKED.

@return true if the CVM state ishas been (atfully least)initialized ACTIVEand is ready for use, false otherwise (i.e. the CVM state is NOT_READY).

Class CVM, boolean isBlocked()

ThisIndicates methodwhether this CVM instance is blocked, indicatesthat is, whether the CVM is currentlyCVM state is BLOCKED.

@return true if the CVM state is BLOCKED, false otherwise.

Class CVM, boolean isSubmitted()

ThisIndicates method indicates whether an attempt has been made to compare the CVM value. Note: This method does, notthat differentiateis, whether the CVM value has beenstate successfully is verifiedINVALID_SUBMISSION or not, i.e. CVM states of VALIDATED or INVALID_SUBMISSION.

@return true if the CVM state is (atINVALID_SUBMISSION least)or SUBMITTEDVALIDATED, false otherwise.

Class CVM, boolean isVerified()

ThisIndicates method indicates whether a successful comparison of the CVM value has occurred, that is, whether the (CVM state ofstate is VALIDATED).

@return true if the CVM state is VALIDATED, false otherwise.

Class CVM, boolean resetAndUnblockState()

ThisResets the CVM state to ACTIVE, even if it is currently BLOCKED.

If the Application invoking this method resetsdoes not have the CVM Management Privilege, then the CVM state fromis BLOCKEDnot updated.

The CVM state can only be set to ACTIVE. Notes: if Thethe CVM Application shall verifyinstance already entered the state ACTIVE once, that is, if the CVM Management privilege usinginstance is fully initialized. If the GPRegistryEntryCVM interfacestate is successfully reset, then this method also resets the CVM try counter ofto the invokingCVM applet;try limit.

Notes:

@return true if the CVM state was reset to ACTIVE, false otherwise. @see GPRegistryEntry#PRIVILEGE_CVM_MANAGEMENT
Class CVM, boolean resetState()

ThisResets method resets the CVM state to ACTIVE.

Notes: The state of the CVM state can only be setreset to ACTIVE from the states ACTIVE, INVALID_SUBMISSION or VALIDATED. TheIn particular, it cannot be reset to ACTIVE if it is in state ofBLOCKED or if the CVM cannot be set toinstance never entered the state ACTIVE, fromthat BLOCKED. is, if the CVM instance is not fully initialized.

@return true if the CVM state was reset, false otherwise.

Class CVM, boolean setTryLimit(byte)

This methodSets the setsCVM try limit, that is, the maximum numbervalue of tries for the CVM. try counter.

Notes: TheIf CVMthe Application shallinvoking this method does not verifyhave the CVM Management privilegeManagement usingPrivilege, then the GPRegistryEntryCVM interface of the invokingtry limit is not applet; set.

TheIf the CVM try counterlimit is resetsuccessfully when settingset, the maximum number ofthen this method also tries; resets Thethe CVM state istry resetcounter to ACTIVEthe new whenCVM try limit. changingIf the maximumCVM number ofvalue has tries. already When setting thebeen successfully set maximumpreviously, number ofthen this triesmethod also before(re)sets the CVMCVM state isto ACTIVE,.

Notes:

@param bTryLimit the maximum number of tries for the CVM. @return true if the maximum number oftry trieslimit was set, false otherwise. @see GPRegistryEntry#PRIVILEGE_CVM_MANAGEMENT
Class CVM, boolean update(byte[], short, byte, byte)

ThisUpdates method changes the CVM value.

Notes: TheIf CVMthe Application shall verifyinvoking the CVM Management privilege usingthis method does not have the GPRegistryEntryCVM interfaceManagement ofPrivilege, the invokingor if applet; the Thespecified invokingformat applet(bFormat) is responsible for specifying the formatunknown of(or the CVMnot supported value; by Thethis CVM Retry Counter is resetinstance), when changingor if the new CVM value; Theis CVM state is resetnot consistent with respect to ACTIVEthe specified whenformat, changingthen the CVM value. is not updated.

When setting If the CVM value before the CVMis state issuccessfully updated ACTIVE,and the CVM state transitions to ACTIVE only iftry limit has already been successfully set thepreviously, Retry Limit is alreadythen this method also set; resets the DataCVM presented always replacestry counter to the previous dataCVM regardlesstry oflimit, itsand format(re)sets orthe CVM length.state Theto CVMACTIVE.

shallNotes:

@param baBuffer the source byte array containing the new CVM value. This bufferMust must be a global byte array. @param sOffset the offset of the new CVM value within source byte arraybaBuffer. @param bLength the length of the new CVM value. @param bFormat the format of the new CVM value: . FORMAT_ASCII, .FORMAT_BCD or .FORMAT_HEX. @return true if the CVM value was changedsuccessfully updated, false otherwise. @see GPRegistryEntry#PRIVILEGE_CVM_MANAGEMENT @exception SecurityException if baBuffer is not a global byte array. @exception NullPointerException if baBuffer is null. @exception ArrayIndexOutOfBoundsException if reading the new CVM value would cause access of data outside array bounds.
Class CVM, short verify(byte[], short, byte, byte)

ThisCompares methoda value compareswith the stored CVM value.

withIf the oneCVM passed asstate is parameter. BLOCKED, Notes: or Ifif the value passedsubmitted asformat parameter(bFormat) is not inunknown the(or same format as thenot supported by this CVM valueinstance), the value passed as parameter mustor if this method throws a beNullPointerException converted prioror an toArrayIndexOutOfBoundsException, comparingthen the comparison is deemed unsuccessful.

If HEXthe formatsubmitted CVM value is presented for CVM verification and ASCII or BCDnot in the same format as the stored CVM value, then format was used for updatingconversion shall occur according to the CVMfollowing value,rules the comparisonprior to fails; comparing values:

whenIf the lengthcomparison is unsuccessful and the data value matchCVM state is exactly; not IfBLOCKED, then the comparison isCVM try successfulcounter must be decremented (by 1). In this case, if the CVM try counter mustreaches a value of '0' then the CVM state shall be reset andset to BLOCKED, otherwise the CVM state muststate shall be set to VALIDATEDINVALID_SUBMISSION.

If the comparison is unsuccessfulsuccessful, then the CVM try counter mustshall be updatedreset to the CVM try limit and the the CVM state mustshall be set to INVALID_SUBMISSIONVALIDATED.

The Retry Counter objectCVM try counter and the CVM states VALIDATED and INVALID_SUBMISSIONstate shall not conform to a transactiontransaction in progress, i.e. they shall not revert to a previous value if aa transaction in progress is aborted; If the maximum number of tries has been reached, the CVM state must be set to BLOCKED.

@param baBuffer the source byte array containing the submitted CVM value. This buffer mustMust be a global byte array. @param sOffset the offset of the submitted CVM value within source byte arraybaBuffer. @param bLength the length of the submitted CVM value. @param bFormat the format of the submitted CVM value: .FORMAT_ASCII, .FORMAT_BCD or .FORMAT_HEX. @return value indicating.CVM_SUCCESS whetherif the comparison was successful, or.CVM_FAILURE otherwise. @exception SecurityException if baBuffer is not a global byte array. Values@exception other thanNullPointerException if CVM_SUCCESSbaBuffer (0)is or null. CVM_FAILURE@exception (-1)ArrayIndexOutOfBoundsException areif reading the submitted CVM Reservedvalue would cause access of data for Future Useoutside array bounds.

Class CVM, byte FORMAT_ASCII

The CVM value is formatted as ASCII bytes.

Note:

Class CVM, byte FORMAT_BCD

The CVM value is formatted as numerical digits, coded on a nibble (4 bits) and left justified.

Note:

Class CVM, byte FORMAT_HEX

The CVM value is formatted as hexadecimal (binary) data.

Note:


Class GPRegistryEntry

This defines the interface correspondinginterface allows querying and topotentially modifying the GPRegistryEntry of a singleregistry data of an Application. The Global Serviceregistered within the GlobalPlatform ApplicationRegistry.

usesEvery thisGPRegistryEntry interfaceinstance to checkan the validity ofApplication registered within the requestGlobalPlatform presentedRegistry.

byTo retrieve an on-card entity. Prior toinstance usingof this interface, an Application is requiredshall to obtain a handle toinvoke thethe GPRegistryEntryGPSystem.getRegistryEntry ofmethod.

an@since

Class GPRegistryEntry, void deregisterService(short)

This method allowsDeregisters a service aname.

Global Services ApplicationThe OPEN shall (e.g.check a CVMthat the Application) invoking this method corresponds to deregisterthis aentry, that it has the Global Service Privilege, and that the specified service name was previously uniquely registered by that same Application. If not, this method shall throw an exception (see below).

Notes: The@param OPENsServiceName the service checksname that theshall be deregistered.

A service requestingname is encoded on-card entity2 hasbytes, the Global Service Privilege1st byte identifying a family of services and is associated with this registrythe 2nd byte identifying a service entry; within that family.

The OPENGPSystem checksclass thatdefines a set of constants FAMILY_XXX (of the byte type) that may be used to build a service name is(of registeredthe short type) suitable to invoke this method as unique forshown in the requestingfollowing on-cardexamples:

@paramexception sServiceName the uniqueISOException if this servicemethod is not supported or if the service name was not found or if the conditions allowing to deregister the service name are not satisfied. @exceptionsee ISOException#registerService with@see theGPSystem#FAMILY_CVM following@see reasonGPSystem#FAMILY_SECURE_CHANNEL code:@see GPSystem#FAMILY_USSM ISO7816.SW@see GPSystem#FAMILY_AUTHORITY @see GPSystem#FAMILY_CONDITIONSHTTP_ADMINISTRATION @see GPSystem#FAMILY_NOTHTTP_SATISFIEDREPORT
Class GPRegistryEntry, AID getAID()

ThisGets method returns the Application's AID registered in the current GlobalPlatform Registry's entry. Notes: Theof OPEN checks that the requesting on-card entity has the Global Service Privilege and is associatedApplication withcorresponding to this registry entry; The OPEN checks that the service name is. registered@return asAID unique forinstance identifying the requesting on-card entity. Application @returncorresponding theto AIDthis objectentry.
Class GPRegistryEntry, short getPrivileges(byte[], short)

ThisGets method returns all the Privileges bytesPrivilege registered inBytes of the currentApplication GlobalPlatform registrycorresponding to this entry. @param baBuffer The byte array where Privileges bytesBytes are toshall be storedwritten. @param sOffset The offset inwithin baBuffer at which to begin the Privileges byteswhere Privileges Bytes shall be written. @return sOffset + Lengthnumber of thePrivilege PrivilegesBytes written to baBuffer. @exception ArrayIndexOutOfBoundsExceptionSecurityException if storingbaBuffer is not accessible in the Privilegescaller's context e.g. bytesbaBuffer is wouldnot a global cause access outsidearray nor an array boundsbelonging orto the sOffsetcaller context. @exception NullPointerException if baBuffer is negativenull. @exception ArrayIndexOutOfBoundsException if writing Privileges Bytes would cause access of data outside array bounds.
Class GPRegistryEntry, byte getState()

ThisGets method returns the Life Cycle State registered inof the current GlobalPlatform RegistryApplication corresponding to this entry. @return Thethe Life Cycle State as defined in sectionof the Application corresponding 11.11to this entry.
Class GPRegistryEntry, boolean isAssociated(AID)

ThisChecks method allows towhether verify if the entitythe Application corresponding to whosethis AID is provided inentry is associated with the inputspecified parametersSecurity isDomain.

registered as the associated Security Domain ofThe OPEN shall check that the specified thissdAID GPRegistryEntry. indeed Notes: identifies Thea OPEN determines ifSecurity Domain present on the SDAIDcard, is registered inand check that thethe Application current GlobalPlatformcorresponding to Registry'sthis entry as the associatedis associated with this Security Domain. If not, this method shall return false.

@param SDAID objectsdAID AID of the investigateda Security Domain. @return Truetrue if the GP RegistryApplication referencescorresponding the Securityto Domainthis as beingentry is associated with this GPRegistryEntry, or the specified Security Domain, Falsefalse otherwise.

Class GPRegistryEntry, boolean isPrivileged(byte)

ThisChecks method allowswhether anthe Application (e.g. a CVM Application)corresponding to verify if a given Privilege isthis registered in this GPRegistryEntryentry has the specified (e.gprivilege.

checkIf the CVMspecified Management privilege of anotheris Applicationunknown, invoking thethis method shall CVM.update()return method)false. @param bPrivilege the privilege number to verifycheck, asi.e. one defined inof the TablePRIVILEGE_XXX 6-1constants. @return Truetrue if at least the referenced Privilege is registered inApplication the GPcorresponding to Registrythis entry, or has False if the referenced Privilege is not registered in thespecified GPprivilege, Registryfalse entryotherwise.

Class GPRegistryEntry, void registerService(short)

ThisRegisters methoda service name allowsidentifying a Globalservice Services Applicationprovided by (e.gthe Application corresponding to this entry.

a CVM The Applicationspecified service name (sServiceName) to registershall be aunique among uniqueall the service identifiernames previously withinregistered in the GlobalPlatformGlobalPlatform Registry using this method. Following successful invocation of this method, Notesthis service name is known to be uniquely registered: no other Application on the card will be able to register the same service name (until this service name is deregistered (see .deregisterService)). If the service name identifies a family of service, no other Application on the card will be able to register a service of that family.

The OPEN checksshall first check that the requestingApplication invoking on-cardthis method entitycorresponds to this entry and that it has the Global ServiceService Privilege.

and is associatedThen the OPEN shall check withthat the currentspecified service name:

If any of the Serviceabove conditions is not satisfied, this method shall throw an exception Parameter(ssee below). Otherwise, recordedthe specified service name shall be uniquely registered in the current GlobalPlatform Registry.

entry; @param ThesServiceName OPENthe service checksname that theshall be uniquely registered.

A service identifiername is notencoded already registeredon 2 asbytes, unique by any otherthe 1st byte identifying entrya family of services in and the GlobalPlatform2nd Registrybyte identifying a service within that family. If @paramthe sServiceName2nd byte is set to 0x00, the caller of this method is registering an entire family of service.

The GPSystem class defines a set of constants FAMILY_XXX (of the uniquebyte type) that may be used to build a service name (of the short type) suitable to registerinvoke this method as shown in the following examples:

@exception ISOException withif this method is not supported or if the conditions allowing to register the following reasonservice name code:are not ISO7816satisfied.SW @see #deregisterService @see GPSystem#getService @see GPSystem#FAMILY_CONDITIONSCVM @see GPSystem#FAMILY_NOTSECURE_SATISFIEDCHANNEL @see GPSystem#FAMILY_USSM @see GPSystem#FAMILY_AUTHORITY @see GPSystem#FAMILY_HTTP_ADMINISTRATION @see GPSystem#FAMILY_HTTP_REPORT
Class GPRegistryEntry, boolean setState(byte)

Sets the Life Cycle state of the Application corresponding to this entry.

This method allowsenforces the Life Cycle stateState of this GPRegistryEntry totransition rules described in beCard Specification v2.2.1 section 5.

If this entry transitionedcorresponds to the Issuer Security Domain (ISD), then the OPEN shall check that the requested targettransition complies statewith Card Life Cycle State transition rules. If needed, the OPEN shall check that the Application invoking this method has the Card Lock Privilege or the Card Terminate Privilege.

Notes Otherwise, the following rules shall apply:

@param bState the targetnew stateLife Cycle State. See Card Specification v2.2.1 section 11.1.1 for thisdetails on Life Cycle GPRegistryEntryState Coding. @returnA Truevalue of ifGPSystem.APPLICATION_LOCKED
the(resp. transition0x00) ismay successful,be used to request locking (resp. unlocking) an Application or a Security Domain (other than or the ISD). @return true if the transition was successful, Falsefalse otherwise.

Class GPSystem

The GPSystemThis class exposes a subset of the behavior of the OPEN to the outside world. The OPEN implements and enforces a Card Issuer's security policy relating to these services. This OPEN classIt provides functionality at the same level as the JCRE, i.e. the "system" context with special privileges. This class is composed of static methods visible to all applets importing the globalplatform package. @since
Class GPSystem, CVM getCVM(byte)

ThisGets methoda reference returnsto a handleCVM toinstance provided by the CVMOPEN.

interfaceSince export file version 1. 1, this Notesmethod allows looking up for CVM instances registered as Global Services by so-called Global Services Applications (i.e. Applications having the Global Service Privilege) and the following mechanism is defined to retrieve such instances:

For backward compatibility, the .CVM_GLOBAL_PIN interfaceconstant correspondingcan still be used to access a Global Service registered with the bCVMIdentifier(.FAMILY_CVM<8|.CVM_GLOBAL_PIN) identifier, or uniquely registered for the entire .FAMILY_CVM family. Whether such This handlea service is thenavailable returned by OPENor not still todepends on the requestingissuer's appletpolicy. @param bCVMIdentifier identifies the requiredrequested CVM interfaceinstance. @return therequested CVM interface objectinstance, reference. or null if there is no matchingthe CVM Interface in the GlobalPlatform Registryrequested CVM instance is not available. @see #CVM_GLOBAL_PIN
Class GPSystem, byte getCardContentState()

ThisGets method returns the Life Cycle State of the current applet context. Notes: The OPEN locates the entry of the current applet context in the Open Platform Registry and retrieves the Life Cycle State.

@return the Life Cycle State of the current applet context. @see #APPLICATION_INSTALLED,INSTALLED @see #APPLICATION_SELECTABLE,SELECTABLE SECURITY_DOMAIN@see #APPLICATION_PERSONALIZEDLOCKED

Class GPSystem, byte getCardState()

ThisGets method returns the Life Cycle State of the card.

@return the Life Cycle State of the card card. @see #CARD_OP_READY,READY @see #CARD_INITIALIZED,INITIALIZED @see #CARD_SECURED,SECURED @see #CARD_LOCKED, LOCKED @see #CARD_TERMINATED

Class GPSystem, GPRegistryEntry getRegistryEntry(AID)

Gets a GPRegistryEntry instance.

This method allows anthe Application (e.g.associated awith the current CVM)applet context to access the GPget its own RegistryGPRegistryEntry entryinstance ofor the one of another Application. If no AID isthe input,aid this method providesparameter is not thenull GP Registry entry ofand does not identify the requesting Application. It returns a handleinvoking this tomethod, the GPRegistryEntry interface. OPEN Notes: shall Thecheck OPEN verifies that the requesting Applicationthat the Application invoking this method has the Global Registry privilegePrivilege. If not, or isthis method shall thereturn null.

@param Security Domain associated withaid the AID of the Application being investigated,whose GPRegistryEntry orinstance is therequested. investigatedUse Applicationnull itself. to retrieve the @paramGPRegistryEntry reqAID identifiesinstance of the requiredcurrent GPRegistryEntry interfaceapplet context. @return The GPRegistryEntry interface reference corresponding to the input AID,requested or GPRegistryEntry nullinstance if there isit no Application inwas found in the GPGlobalPlatform Registry that corresponds toand the input AID or if theApplication requesting Application is not authorizedinvoking this method is allowed to access the corresponding GP Registrythat entry. @see, AIDnull otherwise. @since export file version 1.1

Class GPSystem, SecureChannel getSecureChannel()

This method returnsGets a handle to the SecureChannel interfaceinstance.

Notes: The OPENThis method locatesallows the entryApplication ofassociated with the current appletapplet context in theto Open Platformretrieve a RegistrySecureChannel to determine theinstance provided by application'sits associated Security Domain.

Since export file version 1.1, Thisalthough not required, this method may bebe implemented using athe similar mechanismGlobal Service asfacility, described for thein which case getCVMSecureChannel methodinstances would be registered by Security Domains as Global Services. In this case, Security Domains shall check that they only provide such SecureChannel instances to their associated Applications.

@return the SecureChannel interface object reference. @see #getCVM the GPSystem.getCVM() method for an example of how to access a Global Service.

Class GPSystem, GlobalService getService(AID, short)

This methodGets a returnsGlobalService a handleinstance matching tothe specified service name (sServiceName).

The serverAID parameter is optional (i.e. may be set to null) and identifies the Global Services interfaceApplication providing ofthe aservice.

The OPEN shall look for the Global Services Application. providing Notesthe service:

If a Global Services Application. was found, then the OPEN providesshall retrieve the followingGlobalService
parameters toinstance by invoking the Applet.getShareableInterfaceObject() method: of that Global Services Application with the clientAID isparameter set to the AID of thethe current applet context (i.e. the requestingone on-cardinvoking this entitymethod) and and the parameter isparameter set to .GLOBAL_SERVICE_IDENTIFIER; . The@param serverAID AID of the Global Services Application returnsproviding the requested service, or null if the referencecaller of this method is requesting a uniquely registered service name.

@param sServiceName service name identifying a service or a family of services.

A service name is encoded on 2 bytes, the Shareable1st byte identifying Interfacea family Object implementingof services and the GlobalService2nd byte identifying a service within that interfacefamily. If Thisthe 2nd byte is handleset to 0x00, the GlobalService interface is then returned by OPENcaller of this method is requesting a toservice of the requestingspecified applet. family, but does not care exactly which service within that family.

@paramThis serverAID identifies the required Global Serviceclass defines a set of constants ApplicationFAMILY_XXX AID(of orthe isbyte null. type) @paramthat sServiceName identifies the required Global Service Service Namemay be used to build a service name or(of thethe short type) entiresuitable Serviceto invoke this method as shown in Familythe following examples:

@return the GlobalService instance giving access to interface objectthe requested referenceservice, or null if the Global Services Application could not be found or did not provide a GlobalService instance. @see #GLOBAL_SERVICE_IDENTIFIER @see #FAMILY_CVM CVM @see #FAMILY_SECURE_CHANNEL @see #FAMILY_USSM @see #FAMILY_AUTHORITY @see #FAMILY_HTTP_ADMINISTRATION @see #FAMILY_HTTP_REPORT @see GPRegistryEntry#registerService @since export file version 1.1
Class GPSystem, boolean lockCard()

Locks the card. This method locksshall be used to transition the card to .CARD_LOCKED Life Cycle State.

Notes: The OPEN locates theshall entry ofcheck that the currentApplication applet context in the Open Platform Registryinvoking this method has the Card Lock andPrivilege. verifiesIf thatnot, the application has thetransition card lock privilegeshall be rejected.

@return true if the card was locked, false otherwise.

Class GPSystem, boolean setATRHistBytes(byte[], short, byte)

This methodSets sets the historical bytes of the ATR (Answer To Reset (ATR) string.

This method only updates the ATR string that is used for the contact-based IO interface (as specified by [ISO/IEC 7816] upon power-up or cold reset. The sequenceATR ofstring used for warm reset shall remain unchanged. The new historical bytes willshall be visible onupon anext subsequent power-up or cold reset.

Notes: The OPEN locates theshall entry ofcheck that the currentApplication applet contextinvoking this inmethod has the Open Platform RegistryCard Reset Privilege and verifies that the applicationbLength is has theboth positive "Cardand Reset"lower privilegethan for16. If not, the current cardchange shall I/Obe interface;rejected.

Notes:

@param baBuffer the source byte array containing the ATR historical bytes. @param sOffset offset of the ATR historical bytes within source byte array. @param bLength the numberlength of the ATR historical bytes. @return true if ATR historical bytes were set, false otherwise.
Class GPSystem, boolean setCardContentState(byte)

Sets the Life Cycle state of the Application invoking this method. This method allows the applicationApplication associated with the current appletapplet context to lock itself or to change its state tofrom an application specific lifespecific cycle state orLife Cycle State to lockanother itself.application Anspecific Life applicationCycle State. An Application cannot unlock itself.

using thisThe OPEN method.shall check that @paramthe bStateApplication is currently in an applicationapplication specific lifeLife cycle stateCycle State (i.e. in the range [0x07 to.. 0x7F] and with 3its 3 low order bits set to 1), orin particular that it is not in the .APPLICATION_LOCKEDINSTALLED (0x80)state and not currently locked. If not, the change shall be rejected. @return The OPEN shall check that falsebState ifeither encodes an application specific Life Cycle State or has its high order bit (b8) set to 1: the latter case shall be interpreted as a request from the the Application to lock itself. @param bState either an application invoking this method isspecific Life Cycle State currently(i.e. lockedin the range [0x07 . . 0x7F] and with its 3 low order bits set to 1), or any value having its high order bit (b8) set to 1. A value of .APPLICATION_LOCKED may be used to request locking the Application. @return true if the operationLife isCycle State successfulof the Application was changed, false otherwise. @see #APPLICATION_INSTALLED @see #APPLICATION_LOCKED @since

Class GPSystem, boolean terminateCard()

This methodTerminates terminates the card. Notes: This method shall not be invokedused to fromtransition the Appletcard to .install()CARD_TERMINATED methodLife Cycle State.

The OPEN locates theshall entry ofcheck that the currentApplication applet context in the Open Platform Registryinvoking this method has the Card Terminate andPrivilege. verifiesIf thatnot, the application has thetransition card terminate privilegeshall be rejected.

@return true if the card was terminated, false otherwise.

Class GPSystem, byte APPLICATION_LOCKED

The current applet context is in the Life Cycle State of LOCKED (0x80). To know ifwhether an application is locked or not, a logical AND operationoperation shall be performed between this constant and the current application lifelife cycle state.
Class GPSystem, byte CVM_ETSI_PIN_APP_1

Indicates that the required CVM interface required is the ETSI PIN App 1 (0x01). @since export file version 1.5
Class GPSystem, byte CVM_ETSI_PIN_APP_2

Indicates that the required CVM interface required is the ETSI PIN App 2 (0x02). @since export file version 1.5
Class GPSystem, byte CVM_ETSI_PIN_APP_3

Indicates that the required CVM interface required is the ETSI PIN App 3 (0x03). @since export file version 1.5
Class GPSystem, byte CVM_ETSI_PIN_APP_4

Indicates that the required CVM interface required is the ETSI PIN App 4 (0x04). @since export file version 1.5
Class GPSystem, byte CVM_ETSI_PIN_APP_5

Indicates that the required CVM interface required is the ETSI PIN App 5 (0x05). @since export file version 1.5
Class GPSystem, byte CVM_ETSI_PIN_APP_6

Indicates that the required CVM interface required is the ETSI PIN App 6 (0x06). @since export file version 1.5
Class GPSystem, byte CVM_ETSI_PIN_APP_7

Indicates that the required CVM interface required is the ETSI PIN App 7 (0x07). @since export file version 1.5
Class GPSystem, byte CVM_ETSI_PIN_APP_8

Indicates that the required CVM interface required is the ETSI PIN App 8 (0x08). @since export file version 1.5
Class GPSystem, byte CVM_GLOBAL_PIN

Indicates that the required CVM interface required is a Global PIN (0x11).
Class GPSystem, byte FAMILY_HTTP_REPORT

Indicates the family of the HTTP Report Service Identifier (0x85). Application is not requested to expose this service through .getService(AID, short) @since export file version 1.3

Class GlobalService

This defines the interface forallows requesting a Global Services Application to provide its actual service interface. The Global Services Application uses thisfor interface to check thea Shareable Interface Object validity(SIO) ofproviding the requestactual service.

presented byTo retrieve an on-card entity. Prior toinstance usingof this interface, an Application is required to obtain a handle to the Global Services Application byshall invoking theinvoke the GPSystem.getService() method.

@since export file version 1.1

Class GlobalService, Shareable getServiceInterface(GPRegistryEntry, short, byte[], short, short)

This method returns a handleGets a Shareable Interface Object to(SIO) actually providing the requested service.

interface of a Global ServicesThe Application invoking this method Application.shall set the clientRegistryEntry to its own GPRegistryEntry instance.

Note: The Global Services Application verifiesshall verify the validity of the requestrequest according to its own security policies policies for thisthe specified sServiceName and, based on the identity of the requestingand characteristics of on-cardthe entity and its characteristics as Application invoking this method as registered inby the specified clientRegistryEntry; , Onand a valid servicepossibly based on request,the data contained in the GlobalbaBuffer Servicebyte Applicationarray.

returnsIf the referencerequest is ofvalid, the Shareable Interface Global Service Application Objectreturns a SIO implementing the actual service: this Shareable InterfaceSIO Object may either be this GlobalService instance or another object. If the request is deemed to be invalid, the Global Service Services Application interfaceshall reject the request by either throwing an exception or anotherreturning null.

It is assumed that the Application invoking Javathis method Cardis aware of shareablethe interface; (extension of the Shareable interface) to which the retrieved SIO shall be casted in order to acces the service.

Notes:

@param clientRegistryEntry the GP Registry entryGPRegistryEntry
referenceinstance of thethe requesting on-card entityApplication.

@param sServiceName a service name identifying the requested service.

A service name is encoded on 2 bytes, the 1st byte identifying a family of services and the 2nd byte identifying a service within that family.

@paramThe baBufferGPSystem class defines a set of constants FAMILY_XXX (of the byte type) that may be used to build a service name (of the short type) suitable to invoke this method as shown in the sourcefollowing examples:

@param baBuffer byte array containing additional parameters of the service request, potentially authentication data. Must be global byte array. @param sOffset offset of the additional request parameters within the source byte array. @param sLength length of the additional request parameters. @return the specificSIO serviceproviding interfacethe actual referenceservice, or null if the service is not available or the request was rejected. Alternatively, this method may reject the request by throwing an ISOException. @exception ISOException withif the request was rejected. Although not mandatory, it is recommended to use one of the following reason codes: Alternatively, this method may reject the request by returning ISO7816null.SW_CONDITIONS_NOT_SATISFIED @exception SecurityException if the Global Services Application requires reading data from baBuffer and baBuffer is not a global byte array. @exception NullPointerException if the Global Services Application requires reading data from baBuffer and baBuffer is null. @exception ArrayIndexOutOfBoundsException if the Global Services Application requires reading data from ISO7816baBuffer and reading data would cause access of data outside array bounds.SW @see GPSystem#getService @see GPSystem#FAMILY_SECURITYCVM @see GPSystem#FAMILY_STATUSSECURE_NOTCHANNEL @see GPSystem#FAMILY_SATISFIEDUSSM @see GPSystem#FAMILY_AUTHORITY @see GPSystem#FAMILY_HTTP_ADMINISTRATION @see GPSystem#FAMILY_HTTP_REPORT
Class GlobalService, byte KEY_ACCESS_ANY

Key Access indicating key may be used by the Security Domain and anyany associated applicationApplication (0x00).
Class GlobalService, byte KEY_ACCESS_APPLICATION

Key Access indicating key may be used by any associated applicationApplication but notnot by the Security Domain (0x02).
Class GlobalService, byte KEY_ACCESS_SECURITY_DOMAIN

Key Access indicating key may be used by the Security Domain but not by any associated applicationany associated Application (0x01).

Class HTTPAdministration

This interface handlesdefines ana method to trigger a new HTTP administration session triggering request.

The object implementing this interface shall belongTo retrieve an instance of this tointerface, the JCRE to have an Application shall use the accessGlobalService toinstance, anyif object.available, The HTTPAdministrationregistered with a service shallname verifyof (GPSystem.FAMILY_HTTP_ADMINISTRATION<8|0x00). that@see theGlobalService method@see parametersGPSystem#getService are@since

Class HTTPAdministration, void requestHTTPAdministrationSession(byte[], short, short)

Request anTriggers a new administration session.

The Security Domain of the callingApplication invoking applicationthis method will handle thethe SCP81 (PSK TLS) security of the communication.

The callingApplication applicationinvoking this method will be notified of the requestresult executionof the request if it implements the interface HTTPReportListener interface.

@param triggeringParameters this bufferbyte contains thearray containing administration sessionsession triggering parameters as defined in Amendment Bparameters. @param offset offset of triggering parameters within triggeringParameters triggeringParameters. @param length length of parameters withintriggering triggeringParameters parameters. @exception java.lang.SecurityException if triggeringParameters is notnot accessible in the caller#'s context. @exception java.lang.NullPointerException if triggeringParameters is equalis to null. @exception java.lang.ArrayIndexOutOfBoundsException if offsetreading ortriggering lengthparameters would lead tocommand would cause access of data outside array bounds. @exception javacard.framework.ISOException with one of the following reason codes:


Class HTTPReportListener

An applet may implement thisThis interface in orderdefines a method to receive a notification on HTTPAdministrationupon completion request(success processing. or failure) of an HTTP Administration Session.

Such an applet shall expose the An Application that wishes to receive HTTPReportListenersuch interfacea object(s)notification through shall implement the javacard.framework.Applet.getShareableInterfaceObject(javacard.framework.AID, byte)to return an HTTPReportListener only ifinstance when the clientclientAID AIDparameter is set to null, and the parameter parameter is setset to GPSystem.FAMILY_HTTP_REPORT.

@since

Class HTTPReportListener, void httpAdministationSessionReport(short)

Notifies the appletApplication that the requested HTTPAdministrationSessionHTTP has beenAdministration Session successfully completed or not.

The OPEN notifynotifies the AppletApplication when the HTTPAdministrationSessionHTTP Administration Session endends or when the retry policy is exhausted.

@param status With following meaning Either .HTTP_SESSION_NO_ERROR: HTTPAdministration session End (failure) or .HTTP_SESSION_ERROR: retry policy of the HTTPAdministration session is exhausted(success).

Class HTTPReportListener, short HTTP_SESSION_ERROR

Constant notifying that the HTTPAdministartiona HTTP sessionAdministration Session failsfailed. That Theis, the retry policy of the session is exhausted and the administration sessionsession request is aborted.
Class HTTPReportListener, short HTTP_SESSION_NO_ERROR

Constant notifying that HTTPAdministration session Enda HTTP Administration Session ended successfully

Class Personalization

This interface defines the interface that representsa method through which an applet methodApplication accessible through the OPENmay forward input data to theanother Application's associated Securityand Domain.retrieve The Applet class thatoutput data from that willApplication.

use the additional functionality that allows a Security DomainThis interface shall be implemented by an Application that wishes to pass data toreceive the applet and send backpersonalization data forwarded by its Applet#sassociated data personalization must implement this interfaceSecurity Domain and request outputting response data. TheIn OPEN issuch a responsiblescenario, of calling this new interface ifif the Application implements both the implementedApplication byand the Applet to Personalization personalizeinterface, otherwisethen the interface ApplicationSecurity Domain shall be called. See also section 7.3.3 ofuse the GlobalPlatform Card SpecificationPersonalization v2interface.2 - Personalization

support. @see Application @since export file version 1.2

Class Personalization, short processData(byte[], short, short, byte[], short)

ThisProcesses method processes Applicationapplication specific data received from another entity on the -card entity.

If this other entity is thethe Application invoking this method Application'sis associateda Security Domain, this data is the APDUthen it shall be buffer. assumed Notesthat:

Notes:

@param inBuffer the source byte array containing theinput data. expected by theMust be a applet.global This buffer must bebyte globalarray. @param inOffset starting offset within source byteof input data arraywithin inBuffer. @param inLength length of input data. @param outBuffer the out byte array where theoutput data expected by the Off-Card Entity shall be setwritten. Must This bufferbe a shallglobal be globalbyte array. @param outOffset starting offset within outwhere output bytedata shall be written within array inBuffer. @return Thethe number of bytes setwritten to outBuffer. @exception inoutBuffer atSecurityException if outOffsetinBuffer or outBuffer is not a global byte array. @throws Exceptions thrownexception NullPointerException if areinBuffer Applicationor specificoutBuffer is null. @exception ArrayIndexOutOfBoundsException if reading intput data or writing output data would cause access of data outside array bounds.

Class SecureChannel

This interface defines an interface to bebasic Secure Channel services used to manage entity authentication and protect APDU commands and responses. It is typically exposed by a Security Domain to its associated Applications.

Using an Application that may want toinstance of this interface requires delegateno knowledge of the handlingunderlying ofprotocols, entityalgorithms and secrets used to perform entity authentication and provide integrity and confidentiality of APDU securitycommands and responses, which only need to be known by the provider of the instance.

An Application that wishes to delegate such activities to its associated Security Domain shall retrieve a SecureChannel instance provided by its associated Security Domain using the GPSystem.getSecureChannel method. On some implementations, this SecureChannel instance may also be retrieved using the GPSystem.getService method.

ThisIf the card supports logical channels, this interface is designedresponsible tofor correctly offer interoperability to the Application in that it requires no knowledge handling any indication of a logical channel number present in the class byte of theAPDU mechanismscommands. usedIn particular, it shall be able to perform the authenticationverify and remove or(i.e. ofunwrap) the schemeprotection used(if forany) of an APDU security and shall allow an Application to interfacecommand without altering such indication of a logical channel correctlynumber. withUpon successful initialization of a Secure Channel Session, the implementation shall establish both a compulsory Session Security DomainLevel and a Current Security Level:

See Card Specification v2.2.1 section 10.2.3 for details about abortion and termination of a Secure Channel Session.

Until it is aborted, a Secure Channel Session shall be modifiedbound to the following information:

@since
Class SecureChannel, short decryptData(byte[], short, short)

ThisDecrypts method is used tosensitive decryptuser data located in the input buffer.

Notes: ProcessingThe this method shall complydecryption algorithm and cryptographic key used to thedecrypt rulesdata, of the Secureas well as Channelany padding Protocolmethod, implemented by the Securityare known implicitly and depend Domain; on Thethe Security Domainunderlying security implicitlyprotocol.

knowsIf the key toCurrent be used forSecurity Level is decryption. NO_SECURITY_LEVEL Theor Security Domain is implicitly aware ofthe necessary cryptographic keys are not anyavailable, padding that may be present in the then this method shall throw an exception decrypted(see below).

Otherwise, the data and this isshall be decrypted discarded. and Thethe clear text data replacesshall replace the cipheredencrypted data within the bytebaBuffer byte array. The removal removal of padding may cause the length of the clear text datadata to be shorter than the length of the cipheredencrypted data. The applet is responsible for checking the integrity of the decryptedAny failure in the decryption or padding removal process shall dataresult in an exception being thrown (see below).

Notes:

@param baBuffer byte array containing the source bytedata that arrayshall be decrypted. @param sOffset offset withinof the source byte arraydata to start the decryptionthat shall be decrypted. @param sLength the numberlength of bytesthe todata decryptthat shall be decrypted. @return The length of the clear textdecrypted data, with any padding removed if a padding method is defined for the underlying security protocol. @exception ISOException with one of the following reason codes (other reason codes specific to the underlying security protocol may be returned): @exception java.lang.SecurityException if baBuffer is not accessible inin the caller#'s context e.g. baBuffer is not a global array nor an array belonging to the caller context. @exception NullPointerException if baBuffer is null. @exception ArrayIndexOutOfBoundsException if reading user data or writing decrypted data would cause access of data outside array bounds.
Class SecureChannel, short encryptData(byte[], short, short)

ThisEncrypts sensitive user data.

If this method is used to encrypt data located innot supported by the implementation or the input buffer. underlying Notes: protocol Processingdoes this method shall comply to thenot define any sensitive data encryption rulesmechanism, of the Secure Channel Protocol implemented by theit shall do nothing and simply throw an exception Security(see Domain; below).

The Security Domain is implicitly awareencryption algorithm and cryptographic key ofused to encrypt data, as well as any padding thatmethod, are mustknown beimplicitly and applied todepend on the clearunderlying textsecurity dataprotocol.

prior to encryption according to theIf the Current Security Level is Secure.NO_SECURITY_LEVEL Channelor Protocol; the Thenecessary Securitycryptographic keys Domainare implicitlynot available, then this method shall throw an exception (see below).

knowsOtherwise, the key todata shall be usedpadded for(NOTE: encryption. depends Theon cipheredthe underlying protocol) and encrypted and the encrypted data replacesshall replace the clearclear text data within the baBuffer byte array. AThe Secure Channel Sessionaddition of padding shallmay cause the length of the encrypted data to be opened and a sensitivelonger than the length of the clear text data. encryption keyAny failure in the padding or encryption process shall beresult available; in an exception being thrown (see below).

Notes:

@param baBuffer the byte array containing the data tothat shall be processedencrypted. @param sOffset offset withinof the byte arraydata to start the encryptionthat shall be encrypted. @param sLength the numberlength of bytesthe todata encryptthat shall be encrypted. @return The length of the encrypted data. @exception ArrayIndexOutOfBoundsExceptionISOException with ifone enciphering produces data outside arrayof the following reason codes bounds.(other reason @exceptioncodes ISOException withspecific to the followingunderlying reasonsecurity protocol may be codereturned):
  • ISO7816'6982' if this method is not supported by the implementation.SW_SECURITY_STATUS_NOT_SATISFIED
  • '6985' if athere is no Secure Channel Session currently open.
  • '6700' if the length of the data that shall be encrypted is not openvalid (e.g. underlying algorithm requires data to be block-aligned and input data are not).
@exception java.lang.SecurityException if baBuffer is not accessible inin the caller#'s context e.g. baBuffer is not a global array nor an array belonging to the caller context. @exception NullPointerException if baBuffer is null. @exception ArrayIndexOutOfBoundsException if reading user data or writing encrypted data would cause access of data outside array bounds.
Class SecureChannel, byte getSecurityLevel()

ThisGets method returns, from the requester's standpoint, the Current Security Level coded as a bit-map according to Table 10 1 indicating whether entity authentication has occurred and what level of security is currently applicable to command and response messages processed by the unwrap() and wrap() methods. Notes: AppletsAn Application mustshall invoke this method to ensure that application specific security requirements have beenits previously met or will beown specific security requirements are enforced by the Securitythis Domaininterface. MoreIt than one level of security may be active and theseshall also take into account that the Current Security Level may change during athe Secure Channel, Session (e.g. an R_MAC session may be initiatedenabled or disabled during a C_MACMAC session).

Notes:

@return The currentCurrent Security Level, which is a combination of one or more the following constants:
Class SecureChannel, short processSecurity(APDU)

Processes security related APDU commands. This, methodthat is used by an applet to process, APDU commands that possiblyrelating relate to the security mechanism usedunderlying by the Securitysecurity Domainprotocol.

As the intention is to allow an Application to be associateduse with aSecure Security DomainChannel services without having any knowledge of the security mechanisms used by theunderlying Security security Domainprotocols, thethe appletApplication may assumesassume that APDU commands that it does not recognize areare part of the security mechanism protocol and will be recognized by thethis SecuritySecureChannel Domaininstance. TheTherefore, the applet canApplication may either invoke thisthis method prior to determining if it recognizes the command or only invokeinvoke this method for commands it does not recognize. The method sets the compulsory Session Security Level that is established at Secure Channel initiation and which is required for the whole Secure Channel Session. OnIn successful initialization of the Secure Channel Sessionturn, the Current Security Level is set to the same value as the compulsory Session Security Level. this The Current Security Levelmethod will throw an isISOException updatedif (R-MACit ordoes not) on the successful processing ofrecognize the BEGINAPDU R-MACcommand SESSION / ENDas a security R-MACrelated SESSION commandsAPDU command.

Notes: Processing this method shall comply to the rules of the Secure Channel Protocol implemented by the Security Domain; TheThis method is responsible for receiving the data field of commandsAPDU commands that are recognized; The applet is responsible for recognizing commands(i.e. that the method refusedbelong to process ('6E00'the andsecurity '6D00'protocol);. The applet is responsible for outputting status bytes returnedWhen due to the processing of instructions recognizeda bycommand, thethis method; If response data isshall present,write thisresponse data will be placed in thethe APDU buffer at offset ISO7816.OFFSET_CDATA. The returnor return codea status word indicatesunder the lengthform andof thean ISOException. appletThe isApplication is responsible for outputting thissuch response data. and/or status word.

@param apdu the incoming APDU object. @return the number of bytes to be output (i. e. length of response data). @exception ISOException with a reason code reflecting some error detected by the underlying security protocol, or with one of the following reasonreason codes (otherif security mechanism relatedthe APDU command statusis not words may berecognized and does returned)not relate to the underlying security protocol:

Class SecureChannel, void resetSecurity()

This method is used to reset all information relating toTerminates the current Secure Channel Session. ItThis method resets both the compulsory Session Security Level and thethe Current Security Level to .NO_SECURITY_LEVEL, and resets all terminatesinformation relating to the current Secure Channel Session and(e.g. erasesinternal allstates, session keys).

Notes: It is strongly recommended that applets using the services of a Security Domain invoke this method in theThis method shall not fail and shall simply return if no Secure Channel Session has been Appletinitiated.deselect()

method; Notes:

Class SecureChannel, short unwrap(byte[], short, short)

ThisVerifies method is used to process and verifyremoves the securesecurity messagingprotection of an incoming commandAPDU command according to the security level andthe SessionCurrent Security Level.

ofIf the currentCurrent Secure ChannelSecurity Level Sessionis . NO_SECURITY_LEVEL Notes: and Processingis this method shall comply to the rulesdifferent from the compulsory Session Security Level of(i.e. thea previous Secure Channel Protocol implementedSession bywas theaborted Securitybut Domain; not Iffully NO_SECURITY_LEVELterminated), AUTHENTICATEDthen orthis ANY_AUTHENTICATEDmethod only isshall throw indicated,an exception when(see complyingbelow).

toIf the Secureclass Channelbyte does not indicate secure messaging (according to ProtocolISO/IEC rules7816-4), then this method willshall not attempt any secure messagingto processing on the incomingverify and remove any command,security protection: the incoming command willshall remain as is within thethe incomingbaBuffer APDU objectbyte array and the returned length of the #unwrapped# datashall isbe set toto the value of the sLength parameter, otherwise a security error is returned; .

If the class byte does not indicateindicates secure messaging (according to ISO/IECIEC 7816-4), then this method will notshall attempt any secure messaging processingverifying and removing the security onprotection according to the incoming commandCurrent Security andLevel:

  • If the incoming command will remainCurrent Security Level is as.NO_SECURITY_LEVEL, is.AUTHENTICATED withinor the.ANY_AUTHENTICATED, incoming APDUthen this object.method When complying with the Secureshall not attempt to verify and Channelremove any Protocol rulessecurity protection, the returned lengthincoming of thecommand will #unwrapped#remain dataas is set towithin the valuebaBuffer of thebyte array sLength(with parameter otherwise a securityclass byte indicating secure errormessaging) isand returned; the Thereturned applet is responsible for receivinglength shall be set to the data fieldvalue of the command; sLength parameter.
  • CorrectIncorrect secure messaging processingverification and removal of the unwrap()security willprotection shall result in the incomingan commandexception being reformattedthrown within(see below) and the incoming APDU object withcurrent Secure Channel Session being aborted: all datainformation relating to the secure messaging removed. A reformatted case 1 orSecure caseChannel 2Session, command will include an Lcexcept the compulsory Session Security byteLevel, set toshall be zero; reset.
  • If R_MAC is indicated in theCorrect Current Security Levelverification and removal of the Secure Channel Session, oncesecurity secure messaging processing ofprotection shall result in the incoming command has successfully completed,being R-MACreformatted computation onwithin the thebaBuffer reformatted commandbyte array (ia.ek. after all the data relating to secure messaging has been removed) will be initiateda. If no secure messaging processing was required for the incomingunwrapped command, R-MAC computation will). be initiated on the unmodified incomingA reformatted case 1 or case 2 command, appended with ashall include an Lc byte of zero in eventset ofto a'00'. case
1Notes:
    or
  • The case 2Application is command; implicitly Incorrectresponsible processing offor receiving the unwrap method willdata result infield of the informationincomping relating toAPDU the current Secure Channel being resetcommand prior to invoking this method.
  • This method doesDepending not fail ifon a Secure Channelthe underlying security Sessionprotocol, isif notR_MAC openis (thatindicated is,by when Sessionthe Current Security Level = NO_SECURITY_LEVEL) or if the corresponding, sessionR-MAC keys are notcomputation may be available; initiated Theon method fails if thethe reformatted command once secure messaging ofprocessing of the incoming command is nothas successfully verified or does not matchcompleted. the Current Security LevelIf no secure messaging (asprocessing defined either aswas required for the compulsory Session Security Level set at initializationincoming ofcommand, theR-MAC Secure Channel Session or ascomputation would be initiated on the Current Security Levelunmodified setincoming bycommand, theappended setSecurityLevel()with method).a If theLc byte of method'00' fails,in the Current Security Level is reset toevent NO_SECURITY_LEVEL,of but not the compulsory Session Security Levela case 1 or case 2 command.
@param baBuffer the source ofbyte array containing the data toincoming be unwrappedAPDU command. @param sOffset the offset within baBuffer of the APDU dataincoming to unwrapAPDU command, i.e. the offset of the command headerthe class byte. @param sLength the length of the APDU dataincoming to unwrapAPDU command, i.e the length of thethe entire APDU command (header and+ data field). @return the length of the reformatted (unwrapped) dataAPDU command, i.e the length ofof the entire APDU command (header and+ data field). @exception ISOException with one of the following reason codecodes (otherother securityreason codes specific to mechanism related status wordsthe underlying security protocol may bebe returned):
  • ISO7816'6985' if the Current Security Level is .SWNO_SECURITY_STATUS_NOT_SATISFIEDLEVEL if secure messaging verificationbut the compulsory Session failed. Security ISO7816Level is different from .SW_CLANO_NOTSECURITY_SUPPORTED classLEVEL, bytethat is, a previous Secure Channel Session was aborted but not recognizedfully byterminated. the
  • '6982' if this method failed verifying or removing the security protection of the incoming APDU command.
@exception java.lang.SecurityException if baBuffer is not accessible inin the caller#'s context e.g. baBuffer is not a global array nornor an array belonging to the caller context. @exception NullPointerException if baBuffer is null. @exception ArrayIndexOutOfBoundsException if reading the incoming APDU command would cause access of data outside array bounds.
Class SecureChannel, short wrap(byte[], short, short)

This method applies secure messagingComputes and adds security protection to the currentan outgoing responseAPDU response according to the Current Security Level.

If the Current Security Level is .NO_SECURITY_LEVEL and is different from the compulsory Session Security Level of(i.e. thea previous Secure Channel Session. Notes: was Processingaborted this method shallbut not fully complyterminated), to the rules of the Secure Channelthen this method shall throw an exception Protocol(see below).

implementedOtherwise, by the Securitythis method shall Domain; attempt Thiscomputing method attempts secure messaging processing ofand adding a security protection to the current outgoing responsemessage according whento the Current Security LevelLevel indicates (e.g. .R_MAC and/or .R_ENCRYPTION; ). If the CurrentCurrent Security Level does not indicate R_MACrequire and/orany R_ENCRYPTION,protection when complying withfor APDU responses the(which Secure Channel Protocolincludes the case where rules,there this method will do no processingis no Secure Channel Session currently andopen), the outgoing response message willshall remain as is in the APDU object.within the ThebaBuffer returned length ofbyte array and the #wrapped#returned datalength isshall be set to thea value of the (sLength parameter minus- 2), (indicating the status bytes are no no longer present at the end of the returned data);.

Notes:

@param baBuffer the source of thebyte array containing response data to(including bethe wrapped.expected status bytes). @param sOffset the offset within baBuffer of theresponse data to wrap. @param sLength the length of theresponse data to wrap. Notes: The length Li of the Response Data Field is automatically calculated by the Security Domain and prepended to(including the Response Data Field for computation ofexpected thestatus R-MACbytes). @return the length of the reformatted (wrapped) data. response @exceptiondata, ISOExceptionwith ifsecurity security mechanism relatedinformation added and status words might be returned. @exception ArrayIndexOutOfBoundsException if wrapping produces data outside arraybytes boundsremoved. @exception java.lang.SecurityException if baBuffer is not accessible inin the caller#'s context e.g. baBuffer is not a global array nor an array belonging to the caller context. @exception NullPointerException if baBuffer is null. @exception ArrayIndexOutOfBoundsException if writing security information in baBuffer would cause access of data outside array bounds.
Class SecureChannel, byte ANY_AUTHENTICATED

Entity Any Authentication has occurred (0x40).

Note:

Class SecureChannel, byte AUTHENTICATED

Entity Authentication has occurred as Application Provider (0x80).

Note:

Class SecureChannel, byte C_DECRYPTION

The .unwrap method will decrypt incoming command data (0x02).

Note:

Class SecureChannel, byte C_MAC

The .unwrap method will verify the MAC on an incoming command (0x01).

Note:

Class SecureChannel, byte NO_SECURITY_LEVEL

Entity Authentication has not occurred (0x00).

Note:

Class SecureChannel, byte R_ENCRYPTION

The .wrap method will encrypt the outgoing response data (0x20).

Note:

Class SecureChannel, byte R_MAC

The .wrap method will generate a MAC for the outgoing response data (0x10).

Note:


Class SecureChannelx

This definesinterface is an interface which extendsextension of the SecureChannel Interface and includes ainterface that defines one supplementary method. See to update SecureChannelthe interfaceCurrent forSecurity aLevel description of the underlying interfaceduring a Secure Channel Session.

Prior to using thisAn Application that wishes interface,to an Applicationuse the is SecureChannelx required tointerface shall obtain a handlereference to itsa associatedSecureChannel Securityinstance Domain'sand SecureChannelxtry interface object by invokingto cast it to the SecureChannelx GPSysteminterface.getSecureChannel() method and castingWhether the returnedobjects object to typereturned by the SecureChannelxGPSystem. The SecureChannelxgetSecureChannel Interface shall be implementedmethod also implement the bySecureChannelx a Security Domaininterface is implementation compliantdependent, tohowever, this version ofmay the specification and the corresponding object reference shallbe expressed as a requirement in specific GlobalPlatform configuration bedocuments. exposed@since through

Class SecureChannelx, void setSecurityLevel(byte)

This method updatesUpdates the Current Security Level for. all subsequent invocations ofIf this method is wrap()not andsupported unwrap()by the methods,implementation except when Secure Channel isor the underlying protocol does not active or was aborted duringdefine the same Applicationany sensitive data session. encryption Currentmechanism, Security Level is coded as ait shall do nothing and simply bit-mapthrow according toan exception table(see 10-1below).

The currentCurrent Security Level cannot be set below the compulsory SessionSession Security Level, butybut only equal or above. The Current Security LevelIt may be increased oror decreased during a Secure Channel Session as long as it is at least equalequal to the compulsory Session Session Security Level.

Notes: ThisIf method fails if a Securethe Current Security Level is Channel.NO_SECURITY_LEVEL Session is notor the cryptographic open,keys ifrequired by the corresponding session keys are not new Current Security Level are not available, or ifthen this themethod shall throw an exception (see below).

The new Current Security Level is equal toshall apply for NO_SECURITY_LEVELall subsequent invocations of SecureChannel. wrap and SecureChannel.unwrap methods, except when there is no current Secure Channel Session.

@param bSecurityLevel theThe new Current Security Level, to bewhich shall seta combination of one or more the following constants:

@exception ISOException with one of the following reason codes (otherother securityreason codes specific to mechanism related status wordsthe underlying security protocol may bebe returned):

Class SecureChannelx2

This defines an interface which extendsinterface is an extension of the SecureChannel interface Interface and overrides thethat defines one supplementary method processSecurity(). overriding Seethe SecureChannel interface for a description.processSecurity ofmethod.

the underlyingAn Application interface. that Priorwishes to usinguse thisthe SecureChannelx2 interface, an Application is requiredshall obtain a reference to obtain a handleSecureChannel to its associatedinstance and try to cast Securityit Domain'sto the SecureChannelx2 interface. object by invokingWhether the objects thereturned by the GPSystem.getSecureChannel() method andalso castingimplement the returned objectSecureChannelx2 to typeinterface is SecureChannelx2. implementation Thedependent, SecureChannelx2however, Interface shall be implemented bythis may be expressed as a Security Domainrequirement compliantin to thisspecific version ofGlobalPlatform configuration thedocuments. specification @since and

    the
  • export corresponding objectfile version reference1.4: shallinitial beversion. exposed
  • export through the GPSystemfile version 1.getSecureChannel() method @see6: SecureChannel reviewed @sinceoverall export file version 1description of this interface.4
Class SecureChannelx2, short processSecurity(byte[], short, short, short)

Processes security related APDU commands. This, methodthat is used by an applet to process, APDU commands that possibly relaterelating to the security mechanism used by theunderlying Security Domainsecurity protocol. As the intention is to allow an Application to be associated

with a Security Domain without having any knowledge of the security mechanisms used by the Security Domain, the applet assumes that APDU commands that it does not recognize are part of the security mechanism This and willmethod shall be recognizedused byin the Security Domain. The applet can either invoke this method prior to determining ifsame it recognizesway as the command or only invoke this method for commands it does not recognize. TheSecureChannel.processSecurity method sets the compulsory Session Security, Levelexcept that is established at Secure Channel initiation and which is required for the whole Secure Channelincoming Session. On successfulAPDU initialization ofcommand the Secure Channel Sessionshall be read from, and the Current Security Level is setany response data shall be written to the same value as the compulsory Session Security Level. The Current Security Level is updated (R-MAC or not) on the successful processing of the BEGIN R-MAC SESSION /the END R-MACbaBuffer SESSION commandsbyte array.

Notes:

status @param bytes returned due tobaBuffer byte array containing the processing of instructionsincoming recognized by theAPDU method;command. If response data is present, this data will@param be placed insInOffset offset of the baBufferincoming APDU buffercommand, ati.e. offset specified byof the sOutOffsetclass byte. The return code indicates@param thesInLength length andof the applet is responsible forincoming outputtingAPDU thiscommand, datai. e length of @paramthe baBuffer the sourceentire APDU command and(header response byte+ data arrayfield). @param sInOffsetsOutOffset offset within thebaBuffer source byte arraywhere response data to(if startany) the security processingshall be written. @param sInLengthreturn the number of bytes to process. @parambe sOutOffsetoutput offset(i.e. within thelength of response bytedata). array@exception to start theISOException with a response. reason @returncode the number of bytes to be output reflecting some error detected by the underlying security @throwsprotocol, ISOExceptionor with one of the following reasonreason codes (otherif security mechanism the APDU relatedcommand is status words may benot recognized and does returned)not relate to the underlying security protocol: @exception java.lang.SecurityException if baBuffer is not accessible inin the caller#'s context e.g. baBuffer is not a global array nornor an array belonging to the caller context. @exception NullPointerException if baBuffer is null. @exception ArrayIndexOutOfBoundsException if reading the incoming APDU command would cause access of data outside array bounds.